package org.wms.minbearwcs.controller.Inbound;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.wms.minbearwcs.entity.DTO.inbound.mes.InboundMesCallAgv;
import org.wms.minbearwcs.entity.DTO.response.Resp;
import org.wms.minbearwcs.entity.DTO.transfer.Tuple;
import org.wms.minbearwcs.serivce.inbound.InboundService;

@RestController
@RequiredArgsConstructor
public class InboundPdaController {

    private final InboundService inboundService;

    @PostMapping("/inbound/call/agv")
    public Resp callAgvCommand(@RequestBody InboundMesCallAgv inboundMesCallAgv) {
        Tuple<String> tuple = inboundService.receiveMesCallAgv(inboundMesCallAgv);
        return Resp.build()
                .code(tuple.success)
                .reason(tuple.value);
    }
}
